Skip to content

Conversation

@roszcz
Copy link
Member

@roszcz roszcz commented Aug 7, 2025

Summary of Changes:

  • Refactored the MidiPiece.trim method:
    • Removed the slice_type and shift_time arguments to simplify the API.
    • The method now always trims notes using a standard time window and shifts note timings so the window starts at zero.
    • Removed support for 'index' and 'by_end' slicing modes.
    • Updated related logic in __getitem__ and removed time-shifting functionality from it.
  • Cleaned up and updated associated tests:
    • Removed tests for deprecated slice_type, shift_time, and related edge cases.
    • Adjusted relevant assertions and thresholds in pianoroll viewer tests.
  • Updated usage in pianoroll view to match the new trim method signature.
  • Added a copy method to MidiPiece.

Overall, these changes simplify the codebase, clarify the API, and remove unused or confusing options in MIDI piece trimming.

@roszcz roszcz force-pushed the MIDI-172/trim-deslop branch from eb83e9f to 1d07840 Compare August 7, 2025 11:54
@roszcz roszcz self-assigned this Aug 7, 2025
@roszcz roszcz merged commit 86187b8 into develop Aug 12, 2025
3 checks passed
@roszcz roszcz deleted the MIDI-172/trim-deslop branch August 12, 2025 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants